package net.gz01.wallet.web.config;

import com.jfinal.kit.PathKit;

import java.io.File;

public class SystemEnum {

	/**
	 * 请求响应
	 *
	 * @author zhongzhanfeng
	 *
	 */
	public enum Resp {

		Success("00", "成功"), Fail("01", "失败"), Fail02("02", "未知失败"),  Fail03("03", "审核失败"), NotEnough("11", "余额不足"), InProcess("99", "待确定");

		private String code;
		private String msg;

		private Resp(String code, String msg) {
			this.code = code;
			this.msg = msg;
		}

		public String getCode() {
			return code;
		}

		public String getMsg() {
			return msg;
		}

	}

	/**
	 * 订单状态
	 */
	public enum OrderStatus {
		FirstReview("R1", "待一审"),SecondReview("R2", "待二审"),ThirdReview("R3", "待三审"),
		FirstReviewFail("1F", "一审驳回"),SecondReviewFail("2F", "二审驳回"),ThirdReviewFail("3F", "三审驳回"),
		Success("TS", "成功"), Fail("TF", "失败"), InProcess("IP", "处理中"), Cancle("CX", "已撤销"),WaitTransferOut("WT", "待打款"),
		WaitTransferFail("WF", "打款失败");

		private String value;
		private String name;

		private OrderStatus(String value, String name) {
			this.value = value;
			this.name = name;
		}

		public String getValue() {
			return value;
		}

		public String getName() {
			return name;
		}

	}

	public enum BizType {//此顺序不可变！！！y影响导出Excel表!!!
		Charge("charge", "充值"), TransferOut("transfer_out", "钱包转出账"),TransferIn("transfer_in", "钱包转入账"),
		ExpenseOut("expense_out","商城买卖支出"),ExpenseIn("expense_in","商城买卖收入"),
		Withdraw_Personal("withdraw_personal", "提现(对私)"), Withdraw_Company("withdraw_company", "提现(对公)"),
		DF_Personal("df_personal", "转账到他人卡(对私)"), DF_Company("df_company", "转账到他人卡(对公)"),
		Transfer_xx("transfer_xx", "消费打款(对公)");

		private String value;
		private String name;

		private BizType(String value, String name) {
			this.value = value;
			this.name = name;
		}

		public void setValue(String value) {
			this.value = value;
		}

		public void setName(String name) {
			this.name = name;
		}
		public String getValue() {
			return value;
		}

		public String getName() {
			return name;
		}

	}

	public enum PayOrderItemStatus {
		WaitOne("0", "待一审"), OnePass("1", "一审通过"), OneFail("1F", "一审驳回"), InProcessing("2", "处理中"), TwoFail("2F",
				"二审失败"), TradeSuccess("TS", "交易成功"), TradeFail("TF", "交易失败");

		private String value;
		private String name;

		private PayOrderItemStatus(String value, String name) {
			this.value = value;
			this.name = name;
		}

		public String getValue() {
			return value;
		}

		public String getName() {
			return name;
		}

	}

	public enum PayOrderStatus {
		WaitOne("0", "待审核"), OnePass("1", "一审通过"), OneFail("1F", "一审驳回"), Pass("S", "二审通过"), Fail("2F", "二审驳回");

		private String value;
		private String name;

		private PayOrderStatus(String value, String name) {
			this.value = value;
			this.name = name;
		}

		public String getValue() {
			return value;
		}

		public String getName() {
			return name;
		}

	}

	/**
	 * 取数状态
	 *
	 * @author Reed
	 * @date 2017年10月17日
	 */
	public enum ProcessStatus {
		Init("0"), GetDataSuccess("1"), GetDataFail("2"), CompareSuccess("3");

		private String value;

		private ProcessStatus(String value) {
			this.value = value;
		}

		public String getValue() {
			return value;
		}

	}

	/**
	 * 对账状态
	 *
	 * @author Reed
	 * @date 2017年10月17日
	 */
	public enum CompareStatus {
		Init("0"), LocalError("1"), ChannelError("2"), LocalErrorSuccess("3"), ChannelErrorSuccess("4"), Success("5");

		private String value;

		private CompareStatus(String value) {
			this.value = value;
		}

		public String getValue() {
			return value;
		}
	}

	/**
	 * 出账状态
	 *
	 * @author Reed
	 * @date 2017年10月17日
	 */
	public enum PaymentStatus {
		Init("0"), Freeze("1"), Thaw("2"), Unknown("3"), Fail("4"), Success("5");

		private String value;

		private PaymentStatus(String value) {
			this.value = value;
		}

		public String getValue() {
			return value;
		}
	}

	public enum DataType {
		Local("L"), Channel("C");

		private String value;

		private DataType(String value) {
			this.value = value;
		}

		public String getValue() {
			return value;
		}
	}

	public enum AuditingType {
		Add("0"), Update("1");

		private String value;

		private AuditingType(String value) {
			this.value = value;
		}

		public String getValue() {
			return value;
		}
	}

	public enum ReviewedStatus {
		Submit("0"), Rewrite("1");

		private String value;

		private ReviewedStatus(String value) {
			this.value = value;
		}

		public String getValue() {
			return value;
		}
	}

	private static final String REPORT_PATH = PathKit.getWebRootPath()+File.separator +"upload"+ File.separator; //SystemEnum.FilePath.ReportTmp.getValue();

	//private static final String PDF_PATH = PathKit.getWebRootPath()+File.separator +"pdf"+File.separator;
	public enum FilePath {
//		UploadTmp(SystemConfig.config.get("file_center_path") + "upload/tmp/"), Upload(
//				SystemConfig.config.get("file_center_path") + "upload/"), MerchData(
//						SystemConfig.config.get("file_center_path") + "merch-data/"), Zip(
//								SystemConfig.config.get("file_center_path") + "zip/"), ReportTemplate(
//										SystemConfig.config.get("file_center_path") + "report/template/"), ReportTmp(
//												SystemConfig.config.get("file_center_path") + "report/tmp/");


		UploadTmp(REPORT_PATH + "upload/tmp/"), Upload(
				REPORT_PATH + "upload/"), MerchData(
				REPORT_PATH + "merch-data/"), Zip(
				REPORT_PATH + "zip/"), ReportTemplate(
				REPORT_PATH + "report/template/"), ReportTmp(
				REPORT_PATH + "report/tmp/"),Trade(
				REPORT_PATH + "trade/"),PDF(REPORT_PATH + "pdf/");

		private String value;

		private FilePath(String value) {
			this.value = value;
		}

		public String getValue() {
			return value;
		}

	}

	public enum ChannelCode {
		Local("Local"), Etransfar("Etransfar"), Epaylinks("Epaylinks"), YYT("YYT");
		private String value;

		private ChannelCode(String value) {
			this.value = value;
		}

		public String getValue() {
			return value;
		}

	}

	/**
	 * 分润
	 *
	 */
	public enum ShareStatus {
		No("0"), Yes("1");

		private String value;

		private ShareStatus(String value) {
			this.value = value;
		}

		public String getValue() {
			return value;
		}
	}

}
